Binary rewriters accept a binary executable program as input, and produce an improved executable as output. The output executable usually has the same functionality as the input, but has improved functionality, such as run time, energy use, memory use, security, or reliability.
There are many existing static binary rewriters, such as SecondWrite, Etch, Vulcan, DIABLO, REINS, and PSI. Many static rewriters require additional program information to operate correctly (such as source code, object code, or other compiler artifacts), which may not be available for legacy software. Most static rewriters keep an original copy of the program's code as a hedge against failure when they cannot correctly disambiguate code from data. Others cause significant performance degradation. These space and time overheads can make a rewriter unsuitable for servers and embedded systems.
For example, Barua, et al. (U.S. Pat. No. 8,510,723) discloses a static binary rewriter that is able to rewrite without relocation information. However, the Barua, et al. methodology has difficult rewriting binary files that include indirect control transfers and therefore must provide a hedge that sacrifices the size of the new binary by keeping an image of the original binary in the new binary, which more than doubles the size of the new binary compared to the original binary. Other static binary rewriters have similar issues and also must include the original binary with the new binary, which again, comes at the cost of having to have a disk size that is at least twice as large for the new binary as compared to the original binary. See, for example: (1) Richard Wartell, Vishwath Mohan, Kevin W. Hamlen, and Zhiqiang Lin, 2012, Securing untrusted code via compiler-agnostic binary rewriting, Proceedings of the 28th Annual Computer Security Applications Conference (ACSAC '12), ACM, New York, N.Y., USA, 299-308, http://dx.doi.org/10.1145/2420950.2420995; (2) P. O'Sullivan, K. Anand, A. Kotha, M. Smithson, R. Barua, and A. D. Keromytis, Retrofitting security in COTS software with binary rewriting, Proc. Int. Information Security Conf., pages 154-172, 2011; and (3) Mingwei Zhang, Rui Qiao, Niranjan Hasabnis, and R. Sekar, A platform for secure static binary instrumentation, in Proceedings of the 10th ACM SIGPLAN/SIGOPS international conference on Virtual execution environments (VEE 2014), ACM, New York, N.Y., USA, 129-140, http://dx.doi.org/10.1145/2576195.2576208.
Recently, there has been tremendous growth in the emerging category called the Internet of Things (IoT), which refers to everyday objects, such as, e.g., thermostats, refrigerators, locks, etc., that are “smart.” That is, each of the devices is able to execute dedicated computer programs stored in the memory included in the device, which enables these everyday devices to perform certain functions and communication accordingly via the Internet or other networks.
Sometimes, it becomes necessary to enhance or modify the programs stored in these smart devices by using a static binary rewriter. However, the prior art systems, such as, e.g., that disclosed by Barua, et al. (U.S. Pat. No. 8,510,723) discussed above, require a disk space that is at least twice as large for a new binary file as the original binary file, since they have difficulty rewriting binary files that include indirect control transfers. Unfortunately, it is simply not feasible to require each of these everyday ubiquitous devices to meet such storage requirements.
Accordingly, there is an existing need for a static binary rewriter that is able to rewrite binary files that include indirect control transfers while at the same time have low size and performance overheads.